package com.basics.post.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.basics.api.response.channel.ChannelPostListData;
import com.basics.api.response.channel.PostOrMsgData;
import com.basics.post.entity.CyChannelPost;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 频道帖子 Mapper 接口
 * </p>
 *
 * @author WangWei
 * @since 2025-03-09
 */
public interface CyChannelPostMapper extends BaseMapper<CyChannelPost> {

    PostOrMsgData getLastPost(@Param("channelId") Long channelId);

    IPage<ChannelPostListData> selectChannelPostList(Page page, @Param("channelId")Long channelId
            , @Param("userId")Long userId, @Param("topicId")String topicId);


    List<String> selectUnReadPostList(@Param("userId")Long userId, @Param("channelId")Long channelId);
}
